
import { _decorator, Component, Node, UIOpacity, Button } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('MoreGameCmp')
export class MoreGameCmp extends Component {
    protected _uiOpacity: UIOpacity = null;
    protected _btn: Button = null;

    onLoad() {
        this._uiOpacity = this.node.getComponent(UIOpacity);
        this._btn = this.node.getComponent(Button);
    }

    onEnable() {
        this.checkPlatform();
    }

    checkPlatform() {
        if (HeyGameConfig.HeyGameSDKConfig.onPC
            || HeyGameConfig.HeyGameSDKConfig.onOPPOMiniGame) {
            //开启
            this._uiOpacity.opacity = 255;
            this._btn.interactable = true;
        } else {
            //禁用
            this._uiOpacity.opacity = 0;
            this._btn.interactable = false;
        }
    }



}
